package name.marz.to.go.btree.node;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;


public class TreeMapNodeTest {

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testSplit() throws NodeOverflowException {
		Node node2 = new TreeMapNode(2);
		node2.add(new Key(1), "Key1");
		node2.add(new Key(2), "Key2");
		Node larger_node = node2.split();
		assertEquals(1, node2.getKeyCount());
		assertEquals(1, larger_node.getKeyCount());
		assertEquals(1, node2.getKey(0).getValue());
		assertEquals(2, larger_node.getKey(0).getValue());
		assertEquals("Key1", node2.getPointer(0));
		assertEquals("Key2", larger_node.getPointer(0));
	}

}
